<!DOCTYPE html>
<html>
<head lang="zh">
    <meta charset="UTF-8">
    <!--#include virtual="/public/inc/head.html"-->
    <!--#include virtual="/public/inc/seajs.html" -->
    <title>案场报表</title>
    <link rel="stylesheet" type="text/css" href="/ydxs_static/public/css/css.css" />
    <link rel="stylesheet" type="text/css" href="/public/css/index.css" />
    <style>
        .left-panel-title { height: 40px; line-height: 40px; padding-left: 20px; background-color: #f7f7f7; }
        .left-panel { width: 376px }
        .right-panel { width: 100%; }
        /* 自适应布局 */
        .auto-wrap { width: 100%;}
        .auto-wrap-con {  }
        .selected {background-color: #fff9ee;}
        .options {}
        .options li {float:left; cursor: pointer; margin: 0 5px;}
        .options li a {text-decoration: none;}
        .options li a:hover { text-decoration: underline;}
        .search-title { font-size: 16px; font-weight: 400; float: left; margin: 0 15px 0 6px; }
        .form-item { margin-bottom:20px; text-align: center;}
        .form-item .name {  width: 15%; text-align: right; float: left;margin-right: -94px; margin-top: 4px;}
        .form-item input { width:60%;}
        .form-item .required{color:#f00;}
        .form-item .invalidate { font-size: 10px; display: block; text-align: left; position: relative; left: 22%; margin-top: 5px;}
        .warning {color: #f00;}
        input[type="text"]::-ms-clear{display: none;}
        /* 所属项目的文字超出打点效果 */
        .belong-project{ position: relative; padding: 5px 0; max-height: 34px; overflow: hidden; line-height: 18px;
            text-overflow: -o-ellipsis-lastline; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2;-webkit-box-orient: vertical;}
        /*.belong-project-dotted{ display: none;}
        .belong-project-dotted:after{ content: "..."; background-color: #fff; position: absolute; right: 0; top: 24px; width: 16px}
        .show-dotted .belong-project-dotted{ display: block;}
        .table-wrap tr:hover td .belong-project-dotted:after{background-color: #fff9ee;}*/
        .table-wrap td {  word-break: break-all;max-width: 160px;}
    </style>
</head>
<body>
    <!--#include virtual="/public/inc/top.html" -->
    <div class="container">
        <div class="wrap clearfix">
            <!--#include virtual="/static_public/public_menu/left_side/ydxs/side.html" -->
            <div class="content" ng-controller="dailyReportCtrl">
                <div class="f14 clearfix mt25">
                    <span class="fl lh30">选择具体项目：</span>
                    <div style="width:530px" class="fl limit-ie f12" ui-project-tree data="projectList"
                         ng-model="curProjectId"></div>
                    <!--<a href="/ydxs_static/page/initialize/parameter_settings.html" class="btn mlr5 fr">报表口径配置</a>-->
                </div>
                <div class="toolbar f14 mt15">
                    <div class="toolbar-tab fl">
                        <ul>

                            <li ng-class="{'toolbar-tab-on':dailyType==='day'}" ng-click="changeDailyType('day')"><a href="javascript:;">日报</a></li>
                            <li ng-class="{'toolbar-tab-on':dailyType==='week'}" ng-click="changeDailyType('week')"><a href="javascript:;">周报</a></li>
                            <li ng-class="{'toolbar-tab-on':dailyType==='month'}" ng-click="changeDailyType('month')"><a href="javascript:;">月报</a></li>
                            <li ng-class="{'toolbar-tab-on':dailyType==='during'}" ng-click="changeDailyType('during')"><a href="javascript:;">期间报表</a></li>
                        </ul>
                    </div>
                </div>
                <div class="ng-cloak" ng-show="!dailyLoading">
                    <div class="grid-header clearfix mt10">
                        <span class="fl f14 lh30 text-indent" ng-if="dailyType==='day'">统计日期：{{dayDate}}</span>
                        <span class="fl f14 lh30 text-indent" ng-if="dailyType==='week'">统计日期：{{weekFirst}} —— {{weekEnd}}</span>
                        <span class="fl f14 lh30 text-indent" ng-if="dailyType==='month'">统计日期：{{monthFirst}} —— {{monthEnd}}</span>
                        <span class="fl f14 lh30 text-indent" ng-if="dailyType==='during'">
                            统计日期：
                            <input type="text" name="open_date" ui-date ng-model="queryUnReset.startTime" class="input-text input-data mr10">
                             -
                            <input type="text" name="open_date" ui-date ng-model="queryUnReset.endTime" class="input-text input-data ml10">
                            <a href="javascript: void(0)" class="btn mlr5" ng-click="getCountList()">查询</a>
                        </span>
                        <span class="fl f14 lh30 text-indent ml10" ng-if="dailyType!=='during'&&(countType=='laidian'||countType=='laifan')">截止时间：{{amountData.end_date}}</span>
                        <span class="fl f14 lh30 text-indent ml10" ng-if="dailyType!=='during'&&countType=='renchou'">截止时间：{{amountData.rc_end_date}}</span>
                        <span class="fl f14 lh30 text-indent ml10" ng-if="dailyType!=='during'&&countType=='rengou'">截止时间：{{amountData.rg_end_date}}</span>
                        <span class="fl f14 lh30 text-indent ml10" ng-if="dailyType!=='during'&&countType=='qianyue'">截止时间：{{amountData.qy_end_date}}</span>
                    </div>
                    <div class="rep-style-box clearfix">
                        <div class="col-md-2 rep-style-list clearfix" ng-class="{'rep-current':countType=='laidian'}" ng-click="changeCountType('laidian')">
                            <div class="clearfix">
                                <div class="rep-icon fl"><i class="tel-icon tj-icon"></i>
                                    <span class="f14">来电</span></div>
                                <div class="tip-icon fr tj-icon" ng-mouseenter="laidianShow=true" ng-mouseleave="laidianShow=false"></div>
                            </div>

                            <div class="clearfix rep-bottom mt8 ">
                                <div class="rep-bot-right"><span class="f20">{{amountData.ld}}</span><em class="f12 ml5">(组)</em></div>
                                <div class="tip-layer ng-cloak" ng-show="!!laidianShow" >
                                    <i class="tip-top-icon tj-icon"></i>
                                    <h3>来电客户</h3>
                                    <p>在统计时间内，新增的客户来源为“来电”，或者做过
                                        跟进方式为“来电”的跟进客户数</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-2 rep-style-list clearfix"  ng-class="{'rep-current':countType=='laifan'}" ng-click="changeCountType('laifan')">
                            <div class="clearfix">
                                <div class="rep-icon fl"><i class="visit-icon tj-icon"></i>
                                    <span class="f14">来访</span></div>
                                <div class="tip-icon fr tj-icon" ng-mouseenter="laifanShow=true" ng-mouseleave="laifanShow=false"></div>
                            </div>
                            <div class="clearfix rep-bottom mt8">
                                <div class="rep-bot-left"><span class="f20">{{amountData.lf}}</span><em class="f12 ml5">(总数)</em> </div>
                                <div class="rep-bot-right"><span class="f20">{{amountData.lfn}}</span><em class="f12 ml5">(第一次来访)</em></div>
                                <div class="tip-layer ng-cloak" ng-show="!!laifanShow" >
                                    <i class="tip-top-icon tj-icon"></i>
                                    <h3>来访客户</h3>
                                    <p>在统计时间内，新增的客户来源为“来访”，或者做过跟进方式为“来访”的跟进客户数。</p>
                                    <h3>第一次来访</h3>
                                    <p>在来访客户中第一次到访的客户</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-2 rep-style-list clearfix"  ng-class="{'rep-current':countType=='renchou'}" ng-click="changeCountType('renchou')">
                            <div class="clearfix">
                                <div class="rep-icon fl"><i class="renchou-icon tj-icon"></i>
                                    <span class="f14">认筹</span></div>
                                <div class="tip-icon fr tj-icon" ng-mouseenter="renchouShow=true" ng-mouseleave="renchouShow=false"></div>
                            </div>
                            <div class="clearfix rep-bottom mt8">
                                <div class="rep-bot-right"><span class="f20">{{amountData.rc}}</span><em class="f12 ml5">(笔)</em></div>
                                <div class="tip-layer ng-cloak" ng-show="!!renchouShow">
                                    <i class="tip-top-icon tj-icon"></i>
                                    <h3>认筹客户</h3>
                                    <p>在统计时间内，新增的认筹数减去关闭的但关闭原因不为“转小订”或“转认购”或“转签约”的认筹数。</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-2 rep-style-list clearfix" ng-class="{'rep-current':countType=='rengou','pointer-not':!amountData.isShowDetail}" ng-hide="amountData.isShowDetail && dailyType=='during'" ng-click="changeCountType('rengou')">
                            <div class="clearfix">
                                <div class="rep-icon fl"><i class="rengou-icon tj-icon"></i>
                                    <span class="f14">认购</span></div>
                                <div class="tip-icon fr tj-icon" ng-mouseenter="rengouShow=true" ng-mouseleave="rengouShow=false"></div>
                            </div>
                            <div class="clearfix rep-bottom mt8">
                                <div class="rep-bot-left"><span class="f20">{{amountData.rg.rgTs}}</span><em class="f12 ml5">(套)</em> </div>
                                <div class="rep-bot-right"><span class="f20">{{amountData.rg.rgRMB/10000 | number:2}}</span><em class="f12 ml5">(万元)</em></div>
                                <div class="tip-layer ng-cloak" ng-show="!!rengouShow" >
                                    <i class="tip-top-icon tj-icon"></i>
                                    <h3>认购</h3>
                                    <p>认购口径与ERP口径一致，具体口径请参考ERP</p>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-2 rep-style-list clearfix" ng-class="{'rep-current':countType=='qianyue','pointer-not':!amountData.isShowDetail}" ng-hide="amountData.isShowDetail && dailyType=='during'" ng-click="changeCountType('qianyue')">
                            <div class="clearfix">
                                <div class="rep-icon fl"><i class="qianyue-icon tj-icon"></i>
                                    <span class="f14">签约</span></div>
                                <div class="tip-icon fr tj-icon" ng-mouseenter="qianyueShow=true" ng-mouseleave="qianyueShow=false"></div>
                            </div>
                            <div class="clearfix rep-bottom mt8">
                                <div class="rep-bot-left"><span class="f20">{{amountData.qy.qyTs}}</span><em class="f12 ml5">(套)</em> </div>
                                <div class="rep-bot-right"><span class="f20">{{amountData.qy.qyRMB/10000 | number:2}}</span><em class="f12 ml5">(万元)</em></div>
                                <div class="tip-layer ng-cloak" ng-show="!!qianyueShow" style="left: auto; right:-40px">
                                    <i class="tip-top-icon tj-icon" style="right: 45px; left: auto"></i>
                                    <h3>签约</h3>
                                    <p>签约口径与ERP口径一致，具体口径请参考ERP</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="mt15 clearfix" ng-show="countType!=='rengou'||countType!=='qianyue'">
                        <div class="fl mt5">所属团队：</div>
                        <div class="fl select" style="width:120px;" ui-filtercombobox data="teamList"
                             ng-model="query.teamId" value-field="team_id">
                        </div>
                        <div class="fl mt5 ml10">所属小组：</div>
                        <div class="fl select" style="width:120px;" ui-filtercombobox data="groupList"
                             ng-model="query.groupId" value-field="group_id" ui-disabled="query.groupDisabled" title="{{query.groupDisabled?'请先选择团队':''}}">
                        </div>
                        <div class="fl mt5 ml10">业务员：</div>
                        <div class="fl select" style="width:120px;" ui-filtercombobox data="salerList"
                             ng-model="query.salerId" value-field="user_id" ui-disabled="query.salerDisabled" title="{{query.salerDisabled?'请先选择小组':''}}">
                        </div>
                        <div class="fr btn-group">
                            <a href="javascript: void(0)" class="btn fl mlr5" ng-click="getList()">查询</a>
                            <a href="javascript: void(0)" class="btn btn-yellow mlr5" ng-click="resetQuery()">重置搜索</a>
                            <a href="javascript: void(0)" class="btn btn-yellow" ng-click="exportData()">导出</a>
                        </div>
                        <div class="fr"> <input type="text" name="active_rule" ng-model="query.cstInfo" class="input-text fl mr10 w200" placeholder="姓名／电话"></div>
                    </div>
                    <div class="mt15 clearfix" ng-show="!(countType!=='rengou'||countType!=='qianyue')">

                        <div class="fr btn-group">
                            <a href="javascript: void(0)" class="btn fl mlr5" ng-click="getList()">查询</a>
                            <a href="javascript: void(0)" class="btn btn-yellow mlr5" ng-click="resetQuery()">重置搜索</a>
                            <a href="javascript: void(0)" class="btn btn-yellow" ng-click="exportData()">导出</a>
                        </div>
                        <div class="fr"> <input type="text" name="active_rule" ng-model="query.cstInfo" class="input-text fl mr10 w200" placeholder="姓名／电话"></div>
                    </div>

                    <div class="auto-wrap mt15">
                        <div class="auto-wrap-con clearfix">
                            <div class="fl right-panel">

                                <div class="table-wrap" ng-show="!countLoading">
                                    <table width="100%" ng-if="countType==='laidian'">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th style="width:80px;">姓名</th>
                                            <th>手机</th>
                                            <th>客户来源</th>
                                            <th>业务员</th>
                                            <th>所属组织</th>
                                            <th>客户状态</th>
                                            <th>最近跟进时间</th>
                                            <th>跟进方式</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat=" dailyReport in dailyReportList">
                                            <td height="45">{{(query.pageIndex-1)*queryUnReset.pageSize+$index+1}}</td>
                                            <td>{{dailyReport.cst_name}}</td>
                                            <td>{{dailyReport.mobile_tel}}</td>
                                            <td>{{dailyReport.cst_from_name}}</td>
                                            <td>{{dailyReport.user_name}}</td>
                                            <td>{{dailyReport.organization}}</td>
                                            <td>{{dailyReport.customer_stage_name}}</td>
                                            <td>{{dailyReport.last_date}}</td>
                                            <td>{{dailyReport.gjfs_name}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <table width="100%" ng-if="countType==='laifan'">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th style="width:80px;">姓名</th>
                                            <th>手机</th>
                                            <th>客户来源</th>
                                            <th>业务员</th>
                                            <th>所属组织</th>
                                            <th>客户状态</th>
                                            <th>最近跟进时间</th>
                                            <th>跟进方式</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat=" dailyReport in dailyReportList">
                                            <td height="45">{{(query.pageIndex-1)*queryUnReset.pageSize+$index+1}}</td>
                                            <td>{{dailyReport.cst_name}}</td>
                                            <td>{{dailyReport.mobile_tel}}</td>
                                            <td>{{dailyReport.cst_from_name}}</td>
                                            <td>{{dailyReport.user_name}}</td>
                                            <td>{{dailyReport.organization}}</td>
                                            <td>{{dailyReport.customer_stage_name}}</td>
                                            <td>{{dailyReport.last_date}}</td>
                                            <td>{{dailyReport.gjfs_name}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <table width="100%" ng-if="countType==='renchou'">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th style="width:80px;">姓名</th>
                                            <th>手机</th>
                                            <th>业务员</th>
                                            <th>所属组织</th>
                                            <th>业务类型</th>
                                            <th>业务日期</th>
                                            <th>净认筹</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat=" dailyReport in dailyReportList">
                                            <td height="45">{{(query.pageIndex-1)*queryUnReset.pageSize+$index+1}}</td>
                                            <td>{{dailyReport.cst_name}}</td>
                                            <td>{{dailyReport.mobile_tel}}</td>
                                            <td>{{dailyReport.user_name}}</td>
                                            <td>{{dailyReport.organization}}</td>
                                            <td>{{dailyReport.businessType}}</td>
                                            <td>{{dailyReport.businessDate}}</td>
                                            <td>{{dailyReport.Total}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <table width="100%" ng-if="countType==='rengou'">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>房间名称</th>
                                            <th style="width:80px;">客户姓名</th>
                                            <th>客户电话</th>
                                            <th>业务员</th>
                                            <th>所属组织</th>
                                            <th>业务类型</th>
                                            <th>业务日期</th>
                                            <th>认购金额（元）</th>
                                            <th>认购套数</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat=" dailyReport in dailyReportList">
                                            <td height="45">{{(query.pageIndex-1)*queryUnReset.pageSize+$index+1}}</td>
                                            <td>{{dailyReport.RoomName}}</td>
                                            <td>{{dailyReport.CstName}}</td>
                                            <td>{{dailyReport.CstTel}}</td>
                                            <td>{{dailyReport.UserName}}</td>
                                            <td>{{dailyReport.TeamName}}</td>
                                            <td>{{dailyReport.BizType}}</td>
                                            <td>{{filterDate(dailyReport.BizDate)}}</td>
                                            <td>{{dailyReport.OrderAmount | number:2}}</td>
                                            <td>{{dailyReport.OrderTS}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <table width="100%" ng-if="countType==='qianyue'">
                                        <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>房间名称</th>
                                            <th style="width:80px;">客户姓名</th>
                                            <th>客户电话</th>
                                            <th>业务员</th>
                                            <th>所属组织</th>
                                            <th>业务类型</th>
                                            <th>业务日期</th>
                                            <th>签约金额（元）</th>
                                            <th>签约套数</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat=" dailyReport in dailyReportList">
                                            <td height="45">{{(query.pageIndex-1)*queryUnReset.pageSize+$index+1}}</td>
                                            <td>{{dailyReport.RoomName}}</td>
                                            <td>{{dailyReport.CstName}}</td>
                                            <td>{{dailyReport.CstTel}}</td>
                                            <td>{{dailyReport.UserName}}</td>
                                            <td>{{dailyReport.TeamName}}</td>
                                            <td>{{dailyReport.BizType}}</td>
                                            <td>{{filterDate(dailyReport.BizDate)}}</td>
                                            <td>{{dailyReport.ContractAmount | number:2}}</td>
                                            <td>{{dailyReport.ContractTS}}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <div class="no-data" ng-if="dailyReportList && !dailyReportList.length">
                                        <span>暂无数据</span>
                                    </div>
                                </div>
                                <div class="tab_loading" ng-show="countLoading"><span>加载中...</span></div>
                                <div ui-pagination="" page-index="query.pageIndex" page-size="queryUnReset.pageSize" total="query.total"
                                     changed="getList($pageIndex)"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="tab_loading" ng-show="dailyLoading"><span>加载中...</span></div>


            </div>
        </div>
    </div>
    <script type="text/javascript">
        seajs.use('/ydxs_static/public/js/service/statistical/report_form');
    </script>
</body>

</html>
